﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebApp.Models
{
    public class Stock
    {
        #region Fields

        private String symbol = null;
        private String name = null;
        private double currentPrice = 0.0d;
        private double buyingPrice = 0.0d;
        private double closing = 0.0d;
        private long shares = 0;
        private double fiftyTwoWeekHigh = 0.0d;
        private double fiftyTwoWeekLow = 0.0d;

        #endregion

        #region Properties

        public String Symbol
        {
            get { return symbol; }
            set { symbol = value.ToUpper(); }
        }

        public String Name
        {
            get { return name; }
            set { name = value; }
        }

        public double CurrentPrice
        {
            get { return currentPrice; }
            set { currentPrice = value; }
        }

        public double BuyingPrice
        {
            get { return buyingPrice; }
            set { buyingPrice = value; }
        }

        public long Shares
        {
            get { return shares; }
            set { shares = value; }
        }

        public double Profit
        {
            get { return (CurrentPrice - BuyingPrice) * Shares; }
        }

        public double Closing
        {
            get { return closing; }
            set { closing = value; }
        }

        public double DifferentialProfit
        {
            get { return (CurrentPrice - Closing) * Shares; }
        }

        public double FiftyTwoWeekHigh
        {
            get { return fiftyTwoWeekHigh; }
            set { fiftyTwoWeekHigh = value; }
        }

        public double FiftyTwoWeekLow
        {
            get { return fiftyTwoWeekLow; }
            set { fiftyTwoWeekLow = value; }
        }

        #endregion

        public Stock(String symbol)
        {
            Symbol = symbol;
        }
    }
}